最近在幫學長做MSSQL連結測試 碰到了許多釘子 Orz...
不過好在翻翻error_log再拜一下google大神就解決了
將設定簡化成四個步驟 做個分享 :)
1.
php.ini
extension=php_mssql.dll // 去掉註解
2.
// 將下列二檔案放至 %WINDOWS%/System32/
ntwdblib.dll
php.mssql.dll
// 請確認您的SERVER中有 'php_mssql.dll'
ex.
TWAMPd\app\bin\ext
Appserv\php\ext
3.
restart Apache
可以測試了
$server = 'ip\SQLEXPRESS';
$database = '';
$userid = '';
$password = '';
// Connect to MSSQL
$dbconn = mssql_connect($server, $userid, $password);
//select a database to work with
$selected = mssql_select_db($database, $dbconn)
or die("Couldn't open database $database");